package me.jiatao.javestudy.generic;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by JiaTao on 2018/9/11.
 * Email: 535318720@qq.com
 * Version: 1.0
 * Description:
 */
public class StaticFanction {
    //静态函数
    public static <T> void StaticMethod(T a) {
        System.out.println("StaticMethod: " + a.toString());
    }

    //普通函数
    public <T> void OtherMethod(T a) {
        System.out.println("OtherMethod: " + a.toString());
    }

    //泛型作为返回值
    public static <T> List<T> returnArray(T... args) {
        List<T> modelList = new ArrayList<>();
        for (T arg : args) {
            modelList.add(arg);
        }
        return modelList;
    }

    // 返回泛型数组
    public static <T> T[] returnData(T...arg){
        return arg ;
    }
}


